UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bx3O8U2Ee2/2IBbGwhH61HRvBmhH4Yp2/K8tDUTxQek=' 
WHERE 
  key_id = '6fbe7d5b0a841862489a17cb1d2c98fe1ea24db29a7d5488dcece65e867acfad' 
  AND (
    token = 'bx3O8U2Ee2/2IBbGwhH61HRvBmhH4Yp2/K8tDUTxQek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036