UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qwbt47Fyvw2Zyj7aGCqyV/Nk9BsDlyJjkxvq7CNsm9A=' 
WHERE 
  key_id = 'd872ce20e993fe66d77852dae1e5dfb5a2b4fe87a9c0de557ecedba3e291921b' 
  AND (
    token = 'qwbt47Fyvw2Zyj7aGCqyV/Nk9BsDlyJjkxvq7CNsm9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00103