UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eOSdWi9Qvbhz/xn28RbAyQH0I0YQ88+MsEtbDYy/Xxg=' 
WHERE 
  key_id = '7a6bc612c2a383fb75dcb49efc0c8b797ef0a0080a92ca6b85c67d43af48e877' 
  AND (
    token = 'eOSdWi9Qvbhz/xn28RbAyQH0I0YQ88+MsEtbDYy/Xxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043