UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qMvL5exHztCTWaSREW/v7naifDZMWQyLpIOzrDakXoA=' 
WHERE 
  key_id = 'c0989e5a02c95c3cce83cff09420d5393be3e5e209eb5a8e13d439dc951d85d2' 
  AND (
    token = 'qMvL5exHztCTWaSREW/v7naifDZMWQyLpIOzrDakXoA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013