UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8/YBVd5BgAD+w5gZVPvOZMAH3YNPr0C9s3tkFDa+EP4=' 
WHERE 
  key_id = 'e86bd5bd361ed5234ed45101774c4a8b5d3c9c620eb3855bcf4338d7dc57d35c' 
  AND (
    token = '8/YBVd5BgAD+w5gZVPvOZMAH3YNPr0C9s3tkFDa+EP4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020