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

Query time 0.00034