UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vPkV4HdIADXFKxnVnrUxZqv8MMqt/XRDfDnrop/tPms=' 
WHERE 
  key_id = '788751ab3a67664ffbd2ab79176a6cc9c299b003aecb4f1ed16ed27be6e1c183' 
  AND (
    token = 'vPkV4HdIADXFKxnVnrUxZqv8MMqt/XRDfDnrop/tPms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034