UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1eHdzUapk4z3BfMPbJWjtZUfSueoTzlewIkibUYNEqI=' 
WHERE 
  key_id = '94a9febb58b16ed514cc153cc5a27206042aa65bf548971e765772ca56bf592d' 
  AND (
    token = '1eHdzUapk4z3BfMPbJWjtZUfSueoTzlewIkibUYNEqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031