UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U6f5XSr+sR3oJaAtYK5hAymU4LAsYMKLEXdMUjkHsJM=' 
WHERE 
  key_id = '6e0e4e73e6c72be21ed64cb62ea40b700aafebc83d487102a9e39b77904f6af9' 
  AND (
    token = 'U6f5XSr+sR3oJaAtYK5hAymU4LAsYMKLEXdMUjkHsJM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049