UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TEQprzayY3zMAVds1Hk+CJ1L7Sjj9OfJBu5hJRP7EOo=' 
WHERE 
  key_id = 'b1894f322b2fe23db73a6e6c19f0bdf787efa05209cf4ea58e682e41468dccf9' 
  AND (
    token = 'TEQprzayY3zMAVds1Hk+CJ1L7Sjj9OfJBu5hJRP7EOo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013