UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6pRgh9uOpp2Bw0HbU0CT9qCR5sVGNdEGdcLGZONLDhA=' 
WHERE 
  key_id = 'a242c344968a01a5c92628e1eb43b781d2dd065c79ebcc86fc1d7720046e686e' 
  AND (
    token = '6pRgh9uOpp2Bw0HbU0CT9qCR5sVGNdEGdcLGZONLDhA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022