UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dvtM+ycWkNpRsV2d9SGJxJTO1XZt+aLp/uCPvthUb/c=' 
WHERE 
  key_id = 'c62defe74d05b98c3d75ba3f5d07da596f24d44ad108be048bf67311bafb24c6' 
  AND (
    token = 'dvtM+ycWkNpRsV2d9SGJxJTO1XZt+aLp/uCPvthUb/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056