UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0GfcEbOOF9wLGTqZI3zIjj4dMBxZEq4z9xKsize68fk=' 
WHERE 
  key_id = 'b15745726e91460014db81e372d7635d427cadf01f248cd03fed75f36aaea11f' 
  AND (
    token = '0GfcEbOOF9wLGTqZI3zIjj4dMBxZEq4z9xKsize68fk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033