UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ukWUtCg7zmSNLKzjkbvyE8oL5xYvdcp/gvcqJrQSrg0=' 
WHERE 
  key_id = '1e430e23ae09590f0919b0134751c42c70d7eee428fd26f916570f5737513724' 
  AND (
    token = 'ukWUtCg7zmSNLKzjkbvyE8oL5xYvdcp/gvcqJrQSrg0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019