UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5wjo1F4tNDBUCv2+XV8JO48HPoiK72CtgirtIrhSYFQ=' 
WHERE 
  key_id = '968535afe4f005d5568207df8b0d53836a20cc5700104209020ce6c8d0c6b5b1' 
  AND (
    token = '5wjo1F4tNDBUCv2+XV8JO48HPoiK72CtgirtIrhSYFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018