UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xO6dicRZ+7l9Z8xMOtIosQoGI5B6no2PYDQiI4LhtK8=' 
WHERE 
  key_id = '019c65139314b9dfa09e9aaf301c955f4c30d287d084b88541211ca7e698c7d7' 
  AND (
    token = 'xO6dicRZ+7l9Z8xMOtIosQoGI5B6no2PYDQiI4LhtK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030