UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g6dzsMH2jQm76rHOMLAoCYHxD+qQJ5zxL68Iwr7fG5I=' 
WHERE 
  key_id = '2b7c56dc40493ebc9b43d2e4cf70d805ffd0098a1af5e86673f702b1cf8fe147' 
  AND (
    token = 'g6dzsMH2jQm76rHOMLAoCYHxD+qQJ5zxL68Iwr7fG5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021