UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+qq382o83vdODPGoghyiVRUV1oocXjrCNjVQ1ZneQrE=' 
WHERE 
  key_id = 'c819e38beae5b0761dabf8f90d72ae7ea60a4eba7305570ed1a6ce194ed5be04' 
  AND (
    token = '+qq382o83vdODPGoghyiVRUV1oocXjrCNjVQ1ZneQrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033