UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x64LvSEO/vzJRvYgu+H2Ewc+7zuMNlhRsZyKU7wP6S0=' 
WHERE 
  key_id = '1fbd0e4f3ccd8e37862330b9da28d43aa75f7869840cd488a77477d4e07aa0df' 
  AND (
    token = 'x64LvSEO/vzJRvYgu+H2Ewc+7zuMNlhRsZyKU7wP6S0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045