UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NSBhwMoTJbaF4h0EFUP5ARzP0RYq30f9ZiZhDnjHbcY=' 
WHERE 
  key_id = 'ab81517e7cddefbc6ba0013875a6bc9e0b879fc962e1f72cd4b7972ecd4980a9' 
  AND (
    token = 'NSBhwMoTJbaF4h0EFUP5ARzP0RYq30f9ZiZhDnjHbcY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044