UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g26NEz+oKS+QMdYwR6/tDwK32E5dm8lHjr7v8Y+RffQ=' 
WHERE 
  key_id = '04760f9eab6394d386d7cdf3bac50b19b8453b11a58a9647d027b069798aee7c' 
  AND (
    token = 'g26NEz+oKS+QMdYwR6/tDwK32E5dm8lHjr7v8Y+RffQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033