UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kr+ueuwwT7Tz5nKHbwS+OQ9VYBH6c9WGzbIu8ErPAJc=' 
WHERE 
  key_id = '044249c70e4c1beea96ea0be8be5e75e12d3b279a1b2f3db5f0ca6cd20195264' 
  AND (
    token = 'Kr+ueuwwT7Tz5nKHbwS+OQ9VYBH6c9WGzbIu8ErPAJc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036