UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qVDBDrWBinK059JHj6GJmnlFDqaAp2RJRKv7RKEoxyI=' 
WHERE 
  key_id = '5d0462adb41feab3cd85a847b1fb9aeccb6cdb9a8348b0a1debee23de6ec618a' 
  AND (
    token = 'qVDBDrWBinK059JHj6GJmnlFDqaAp2RJRKv7RKEoxyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041