UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w6Ulc5bX6Dn2hsSw1qk67AaO9giM/6MqI9+DKbjU0aE=' 
WHERE 
  key_id = '80557c5e2a00d9771632fb5fa31bb2817046d0293cd2f65e9292ef8f73d1f8ef' 
  AND (
    token = 'w6Ulc5bX6Dn2hsSw1qk67AaO9giM/6MqI9+DKbjU0aE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039