UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wWr1X3z/VEbyPDW7o7XWwjNQMe3ylgL1b1cokmBBKQg=' 
WHERE 
  key_id = '1b9c58b64808abde124ed72d0acd95f43bb1c1175c68e7175575338c59d74368' 
  AND (
    token = 'wWr1X3z/VEbyPDW7o7XWwjNQMe3ylgL1b1cokmBBKQg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048