UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ljuaD4qpG3//Ic8FpZYXV8XdWfAEVfnFyps2Iq/qj2g=' 
WHERE 
  key_id = 'abf1fb52fd57ce38c290269802fbfb35aa2785fa2a41ef9e262af4fe3cf0d534' 
  AND (
    token = 'ljuaD4qpG3//Ic8FpZYXV8XdWfAEVfnFyps2Iq/qj2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020