UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VUFpwIm/rDRsTN5kC2jqASEr1hYueboCtjHJuvhUT8I=' 
WHERE 
  key_id = '1dda1397042d6af235c498a3aa789b9a153de5df0196c6bdab05350fba5eb21b' 
  AND (
    token = 'VUFpwIm/rDRsTN5kC2jqASEr1hYueboCtjHJuvhUT8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039