UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iTy7/cdYaozInD0zgl/rkGu9knKVCPTko3LrmmEjNfo=' 
WHERE 
  key_id = 'ebffd9b1a12d12f9f82da2b7ecfe6d15061ebe05d72fba3ca0348b0076bd8b4f' 
  AND (
    token = 'iTy7/cdYaozInD0zgl/rkGu9knKVCPTko3LrmmEjNfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022