UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gJW92a1GK3jj1wZIUpnnNYMIp05vqGCAgHhR/qzo5po=' 
WHERE 
  key_id = '886165ed707dff8a8e7a93cdc120b328a7e3514e32956c378574687ac7b4e4c5' 
  AND (
    token = 'gJW92a1GK3jj1wZIUpnnNYMIp05vqGCAgHhR/qzo5po=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030