UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WH0D9bjM5s8oQGxkQLfHkx/k0cC2Nz1YzHxHOSYx37s=' 
WHERE 
  key_id = '159adc92c40ef8766ed6342914b8a16172bbe2af7269231c6a4b53a7d278b1c5' 
  AND (
    token = 'WH0D9bjM5s8oQGxkQLfHkx/k0cC2Nz1YzHxHOSYx37s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024