UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aG1RLtlS93/oQG8BFt3W08MI9f7A+e+CTuhh1/IKowI=' 
WHERE 
  key_id = '098a48e55287c94e441cc50427ea7d4f61a05eee108f53e0be82df087eb61100' 
  AND (
    token = 'aG1RLtlS93/oQG8BFt3W08MI9f7A+e+CTuhh1/IKowI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030