UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vo3COVQOtRrrDjT8DKZxCyhe17ZVNwvGbMyzTdA5Qtc=' 
WHERE 
  key_id = 'be37baed6949874f101d62a5208b0322ec08526f1977a3f5acc6967b88700644' 
  AND (
    token = 'Vo3COVQOtRrrDjT8DKZxCyhe17ZVNwvGbMyzTdA5Qtc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053